#include "widget.h"
#include "mybutton.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    resize(300,300);
    //  创建一个MyButton
    MyButton *button = new MyButton;
    button->setParent(this);
    button->setText("关闭窗口");
    button->move(120,120);
    connect(button, &QPushButton::clicked, this, &QWidget::close);
}

Widget::~Widget()
{
}

